﻿@using JewererBasic.Models
@model IEnumerable<ProcessReportModel>

@{
    ViewBag.Title = "Process Report";

    var gd = new WebGrid(
            Model,
            canPage: true,
            rowsPerPage: 50,
            selectionFieldName: "selectedRow",
            ajaxUpdateContainerId: "gridContent"
        );
    gd.Pager(WebGridPagerModes.NextPrevious);
}

<h2>Process Report</h2>

@using (Html.BeginForm())
{
    <fieldset>
        <table>
            <tr>
                <td>
                    @Html.TextBox("txtOrderId", "", new { id = "txtOrderId", placeholder = "Order Id" })
                </td>
                <td>
                    @Html.TextBox("txtFinishWeek", "", new { id = "txtFinishWeek", placeholder = "Finish Week" })
                </td>
                <td>
                    @Html.DropDownList("txtKind", new SelectList(@ViewBag.ListKinds, "Id", "Name"), "All", new { id = "txtKind", placeholder = "Kind" })
                </td>
                <td>
                    @Html.TextBox("txtProductId", "", new { id = "txtProductId", placeholder = "Product Id" })
                </td>
                <td>
                    <input type="submit" value="SEARCH" name="submit" />
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <div id="stoneListDiv">
                        @gd.GetHtml(
                tableStyle: "table",
                headerStyle: "head",
                rowStyle: "row",
                alternatingRowStyle: "altRow",
                selectedRowStyle: "selectRow",
                columns: gd.Columns(
                gd.Column(header: "Process Step", format: @<div style="width: 250px; text-align: center;"><span><span id="spanId_@item.ProcessId">@item.ProcessName</span></span></div>),
                gd.Column(header: "Quantity", format: @<div style="width: 200px; text-align: center;"><span><span id="spanQuantity_@item.ProcessId"><a href='@Url.Action("BagsInProcess", new { processId = item.ProcessId })'>@item.Quantity</a></span></span></div>),
                gd.Column(header: "Weight", format: @<div style="width: 200px; text-align: center;"><span><span id="spanWeight_@item.ProcessId">@item.Weight</span></span></div>)
            ))
                    </div>
                </td>
            </tr>
        </table>

    </fieldset>
}